<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'goodstype.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
<!-- 最新版本的 Bootstrap 核心 CSS 文件 -->
<link rel="stylesheet"
	href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css"
	integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u"
	crossorigin="anonymous">

<!-- 可选的 Bootstrap 主题文件（一般不用引入） -->
<link rel="stylesheet"
	href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap-theme.min.css"
	integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp"
	crossorigin="anonymous">

<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
<script
	src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"
	integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa"
	crossorigin="anonymous"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath}/js/jquery.js"></script>
<script type="text/javascript">
$(function(){
			$.ajax({
				url : "${pageContext.request.contextPath}/Goodstype/findsupplier.action",
				type : "POST",
				dataType : "json", 
				data : {
				},
				success : function(result, start, resp) {
				var str = "";
				for(var i=0;i<result.length;i++){
					str +="<option value="+result[i].uuid+">"+result[i].name+"</option>";
				}
				$("#sid").html(str);
			 }
		});
	});	
				
	function test(){
	     var name =$("#name1").val();
		 var supplieruuid =$("#sid").val();  
		  alert(sid);
		$.ajax({
				url : "${pageContext.request.contextPath}/Goodstype/findgoodstype.action",
				type : "POST",
				dataType : "json", 
				data : {
					"supplieruuid":supplieruuid,
					"name":name
				},
				success : function(result, start, resp) {
				var str = "<tr><td>供应商</td><td>类别名称</td><td>操作</td></tr>";
				var shan= '<a href="${pageContext.request.contextPath}/supplier/delsupplier.action?id="><i class="icon-remove"></i></a>';
				var xiu= '	<button class="btn btn-xs btn-warning"><i class="icon-pencil"></i> </button>';
				for(var i=0;i<result.length;i++){
				    	str += "<tr><td>"
						+result[i].sname+"</td><td>"
						+result[i].name+"</td><td>"
						+shan+xiu+"</td></tr>";
				    } 
				$("#t1").html(str);
			 }
		});
	}
</script>
</head>
<jsp:include page="/jsp/css.jsp"></jsp:include>
<body>

	<!-- top.jsp -->
	<jsp:include page="/jsp/top.jsp"></jsp:include>

	<!-- header.jsp -->
	<jsp:include page="/jsp/header.jsp"></jsp:include>

	<div class="content">
		<!-- left -->
		<jsp:include page="/jsp/left.jsp"></jsp:include>
		<div class="mainbar">

			<!-- Page heading -->
			<jsp:include page="/jsp/topshou.jsp"></jsp:include>

			<!-- Matter -->
			<div class="matter">
				<div class="container">
			<h4><span class="page_title">商品类别管理</span></h4>
	<div class="container">
		<form class="form-inline" action="${pageContext.request.contextPath}/Goodstype/updategoodstype.action" method="post">
		<input type="hidden" name="uuid" value="${findgoodsty.uuid}">
		<label for="exampleInputName2">供应商:</label> 
			<select class="kuan" id="sid" name="supplieruuid">
								<option value="-1">----请-选-择----</option>
							</select>
			<div class="form-group">
				<label for="exampleInputName2">类别名称:</label> 
				<input type="text"
					class="form-control" id="name1" size="18" name="name" value="${findgoodsty.name }">
			</div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			
			<button type="submit" class="btn btn-default">修改</button><p>
		</form>
	</div>
	<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
	<script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script>
	<!-- Include all compiled plugins (below), or include individual files as needed -->
	<script src="js/bootstrap.min.js"></script>
			</div>
			</div>
		</div>
		<!-- Mainbar ends -->
		<div class="clearfix"></div>
	</div>
	<!-- Footer starts -->
	<jsp:include page="/jsp/butter.jsp"></jsp:include>
	<span class="totop"><a href="#"><i class="icon-chevron-up"></i></a></span>
	
	<jsp:include page="/jsp/js.jsp"></jsp:include>
	
</body>
</html>
